const router = require('koa-router')()
const multiparty = require('koa2-multiparty')

router.prefix('/upload')

router.post('/', multiparty({uploadDir: './public/upload'}), async (ctx,next) => {
    let files = ctx.req.files;
    let url = files.file.path.slice(14)
    console.log(url);
    ctx.body={
        code:200,
        msg:"操作成功",
        url,
    }
})



module.exports = router